"""
File parsers package for extracting text from various file formats
"""

from .base import FileParser, ParseResult, FileType
from .pdf_parser import PDFParser
from .word_parser import WordParser
from .excel_parser import ExcelParser
from .markdown_parser import MarkdownParser
from .image_parser import ImageParser
from .text_parser import TextParser

# Parser registry
PARSER_REGISTRY = {
    FileType.PDF: PDFParser,
    FileType.WORD: WordParser,
    FileType.EXCEL: ExcelParser,
    FileType.MARKDOWN: MarkdownParser,
    FileType.IMAGE: ImageParser,
    FileType.PLAIN_TEXT: TextParser,
}

def get_parser(file_type: FileType) -> FileParser:
    """Get parser instance for file type"""
    parser_class = PARSER_REGISTRY.get(file_type)
    if not parser_class:
        raise ValueError(f"No parser available for file type: {file_type}")
    return parser_class()

__all__ = [
    "FileParser",
    "ParseResult", 
    "FileType",
    "PDFParser",
    "WordParser", 
    "ExcelParser",
    "MarkdownParser",
    "ImageParser",
    "TextParser",
    "get_parser",
    "PARSER_REGISTRY"
]